Use of word processing program modules has increased in recent years due in part to the flexibility and simplicity of these programs. Oftentimes, documents with tables are produced using these word processing program modules.
Unfortunately, documents with tables are not as easy to produce as documents of entire text. Thus, word processing program developers have tried to develop easier, simpler, and more user-friendly mechanisms for producing and editing tables in an electronic document in order to provide a more competitive word processing program.
In order to better understand how tables are produced and stored in an electronic document, it is helpful to review how elements of a document, in general, are produced and stored. Some word processing program modules store elements of an electronic document on a character basis. For these character word processing program modules, new table-forming characters may be added as characters to the word processing program module so that tables may be inserted into a document. For example, referring to FIG. 1, several different table-forming characters 10 are illustrated: a horizontal line 15, a vertical line 20, corner characters 25, 30, 35, 40, four-way junction 45, and t-junctions 50, 55. Using these table-forming characters 10, a user may construct a table of virtually any size and shape using either a keyboard or a mouse to add the table-forming characters to a document.
In early versions of program modules with table-forming characters, the addition of textual characters to a table might destroy the shape of the table since any added characters could push or move the table-forming characters and, thus, destroy the shape of the table. In later improvements, program modules were provided with some intelligence to determine whether the characters on a line constitute a table and, if so, to make certain adjustments. For example, the program may make an adjustment to switch to an overtype mode or to wrap text to the next line. Although table-forming characters provide an adequate solution for tables in word processing program modules that store elements on a character basis, some word processing program modules do not store elements of a document on a character basis. Thus, a different solution is needed to provide easy-to-use tables for these program modules.
Some word processing program modules store text as a stream of characters with paragraph marks. The paragraph marks hold formatting information for the stream of characters. Typically, in these stream-based program modules, cells in a table are composed of a series of paragraphs with special table formatting. The special table formatting may describe attributes of the cell such as the type of border of the cell, the row that the cell is in, the height of the row, whether text is displayed at the top, the middle, or the bottom of the cell, justification of text in the cell, and other attributes. Thus, although the table appears on screen as a single object, it may be stored as a series of paragraphs.
Some word processing program modules also include master cells and slave cells for tables. Typically, master cells control the formatting of slave cells. Slave cells are suppressed, i.e., their borders, contents, etc., are controlled by the master cell. Referring now to FIG. 2, a table 200 is illustrated including master cells and slave cells. In FIG. 2, the dashed lines represent lines that define cell borders, but which are not displayed on-screen. It should be understood that a row in a table typically must be the same height across the entire row. Thus, there is a need for master cells and slave cells. Cell 205 appears to the user as one large cell when it is actually composed of four cells: a master cell 210 and slave cells 215. It should also be understood that cell 217 is composed of master cell 220 and slave cells 225. Generally, all slaves cells must be calculated before the complete cells 205, 217 can be drawn because the complete cell boundaries are not known until all the slave cells have been calculated.
In some stream-based word processing program modules, a table drawing tool for drawing tables is available. Generally, a table drawing tool allows a user to insert a one-cell table by clicking down a mouse button at a point in a document. The user holds down the mouse button and drags the mouse to increase or decrease the size of the table. When the user releases the mouse button, the table is inserted into the document at the insertion point. Prior to the availability of a table drawing tool, a table was inserted into a document by selecting an insert table command from a menu.
Although using the prior art table drawing tools are more convenient than selecting an insert table command from a menu, there are problems with these prior art table drawing tools. In the prior art, the situation in which a table is drawn on top of existing text is not handled the way users expect. A user draws a table over text, expecting it to become a table around existing text, but instead the text is pushed up or down in the document and the table is inserted with no text inside. For example, referring now to FIG. 3A, a prior art table drawing tool 300 is illustrated. As shown in FIG. 3A, a table drawing tool 300 is typically displayed on a viewing screen or display as a pen, or stylus. The dashed line in FIG. 3A represents a new table 305 to be inserted into a document 310. The document 310 includes a first sentence 315, a second sentence 320 and a third sentence 325. The new table 305 begins at insertion point 330 when the user clicks a mouse button to insert the new table 305. The new table 305 ends at end point 335 after the user drags the mouse to end point 335 and releases the mouse button. It should be understood that the new table is typically represented by a dashed line until the user releases the mouse button. Thus, as shown in FIG. 3A, the new table 305 has not yet been inserted into the document and the user has not yet released the mouse button.
Still referring to FIG. 3A, it will be seen that new table 305 completely covers the second sentence 320 and the third sentence 325. A user generally expects the second sentence 320 and the third sentence 325 to be inside the new table 305 after the mouse button is released. However, as shown in FIG. 3B, that is not the case with the prior art table drawing tools.
Referring now to FIG. 3B, the new table 305 of document 310 is illustrated. The new table 305 is a solid line in FIG. 3B demonstrating that the mouse button has been released and new table 305 has been inserted into the document 310. New table 305 has been inserted into the document at the insertion point 330, but the second sentence 320 and the third sentence 325 are no longer inside the table 305. Thus, there is a need for inserting a table into a document such that a table may be inserted over existing text with the existing text placed inside the table.
Another problem of the prior art table drawing tools is that when a user attempts to split a table cell with text into two table cells, one cell is typically expanded to include all the text, when the user actually wanted to split the text between the two cells. For example, users might put spaces or tabs to separate text and may believe they could split the text into two cells at the point of the spaces or tabs. This does not work with the prior art table tools because of the stream-based structure of word processing program modules.
Referring now to FIG. 4A, a table drawing tool 405 in a document 410 has been dragged vertically downward from insertion point 415 to an end point 420 to form a cell border 422. As illustrated in FIG. 4A, the cell border 422 has not been placed inside the document 410 yet, as indicated by the dashed line. First sentence 425, second sentence 430 and third sentence 435 are inside an existing table 440. Generally, when the user releases the mouse button to insert the cell border 422 into the document, the user expects that the sentences 425, 430 and 435 will be split at the cell border 422. As illustrated in FIG. 4B, this is not the result with the prior art table drawing tool.
Referring now to FIG. 4B, the table 440 of document 410 has been split into two cells 445, 450. However, the cell 445 has been expanded vertically to accommodate the sentences 425, 430, and 435. No text is displayed in a cell 450. This is a result that the user typically does not expect. Thus, there is a need for splitting a cell in a table such that the text inside the cell is split between the two cells.
Another problem with prior art table drawing tools is the inability to add cells to the sides, top, or bottom of a table. Thus, there is a need for adding cells to the sides, top, or bottom of a table.
In summary, there is a need in the art for a method and system for inserting a table into a document such that a table may be inserted over existing text with the existing text placed inside the table. There is a further need in the art for a method and system for splitting a cell in a table such that the text inside the table is split between the two resulting cells. There is still a further need for a method and system for adding cells to the sides, top, or bottom of a table using a table drawing tool.